package com.xopencode.process;

import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;

/**
 * @author Mcb
 * @date 2022/3/19
 * @apiNote 进程开启
 */
public class RunProcess {
    public static void main(String[] args) {
        try {
            /*Process process = null;
            String line = null;
            BufferedReader stdout = null;

            process = Runtime.getRuntime().exec("CMD.exe /C dir", null, new File("D:/idea/test/test.txt"));
            stdout = new BufferedReader(new InputStreamReader(process.getInputStream()));
            while ((line = stdout.readLine()) != null){
                System.out.println(line);
            }*/

            String [] cmd={"cmd","/C","start copy exe1 exe2"};
            Process proc =Runtime.getRuntime().exec(cmd);

        }catch (Exception e){
            System.out.println(e.toString());
        }
    }
}
